package com.yurun.common;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 宫静雨
 */
@RestControllerAdvice
public class CustomerGlobalException {
    private static final Logger logger = LoggerFactory.getLogger(CustomerGlobalException.class);

    @ExceptionHandler(RuntimeException.class)
    public Result runtimeException(RuntimeException e) {
        logger.error("{}", e.getMessage());
        return Result.res("00005", "RuntimeException");
    }
}